<?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace yi\think;


/**
 * SmartyViewRenderer allows you to use Smarty templates in views.
 *
 * @author Alexander Makarov <sam@rmcreative.ru>
 * @author Henrik Maier <hwmaier@gmail.com>
 * @since 2.0
 */
class ViewRenderer extends \yi\base\ViewRenderer
{
    /**
     * @var \think\Template $template
     */
    protected $template;

    public $templateClass = '\think\Template';

    public function init()
    {
        $this->template = new $this->templateClass();
    }


    public function render($view, $file, $params)
    {
        $this->template->assign(['app' => \Yi::$app]);
        $this->template->fetch($file, $params);
    }
}
